import * as actionTypes from './constants'
import axios from 'axios'

export const changeBannersAction = (banners) => ({
  type: actionTypes.CHANGE_BANNERS,
  banners
})

export const fetchHotSuggestsAction = () => {
  return (dispatch, getState) => {
    axios.get("http://codercba.com:1888/api/home/hotSuggests").then(res => {
      const list = res.data.data.map(item => item.tagText.text)
      dispatch(changeBannersAction(list))
    })
  }
   
}